package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.entity.dto.Merchant;
import com.qf.mapper.MerchantMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class MerchantService extends ServiceImpl<MerchantMapper,Merchant> {
    @Transactional(readOnly = true)
    public Merchant getByUserNamePwd(String username, String password) {
        QueryWrapper<Merchant> wrapper = new QueryWrapper<>();
        wrapper.lambda()
                .eq(Merchant::getUsername,username)
                .eq(Merchant::getPassword,password);
        return this.getOne(wrapper);
    }
}
